package com.wwlwxg.string;

import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
import java.util.TimeZone;

public class AAA {
	static {
		System.out.println("=======================");
	}

	public static void main(String[] args) {
		long oneData = 24*60*60*1000;
//2019-10-26 04:00:00
		long startTime = 1572055200000L;
//2019-10-26 06:00:00
		long endTime = 1572062400000L;
		SimpleDateFormat bjSdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		TimeZone timeZone = TimeZone.getTimeZone("Europe/Madrid");
		bjSdf.setTimeZone(timeZone);
//		System.out.println(bjSdf.format(new Date(startTime)));
//		System.out.println(bjSdf.format(new Date(endTime)));
//		System.out.println(bjSdf.format(new Date(startTime+oneData)));
//		System.out.println(bjSdf.format(new Date(endTime+oneData)));
//
//		String[] availableIDs = TimeZone.getAvailableIDs();
//		System.out.println(Arrays.asList(availableIDs));

		System.out.println("=========================================");

		Date date = new Date(startTime);
		Calendar calendar = Calendar.getInstance(timeZone);
		calendar.setTime(date);
		calendar.add(Calendar.DAY_OF_MONTH,1);
		long end = calendar.getTime().getTime();

		System.out.println((startTime - end)/1000.0/60/60);
	}
}
